import { getApiData } from "../../tools/HttpClient";
export async function getChangeApiNameData(apiName, params) {
    if (!params.dbname)
        return [];
    const res = await getApiData(apiName, params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}
export async function getPZBOneVoucherDetail(params) {
    if (!params.dbname)
        return Promise.resolve({
            data: [],
            success: false,
        });
    const res = await getApiData("account.PZB.getOneVoucherDetail", params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}
export async function getPZBOneVoucherDetailOfAssist(params) {
    if (!params.dbname)
        return Promise.resolve({
            data: [],
            success: false,
        });
    const res = await getApiData("account.PZB.getOneVoucherDetailOfAssist", params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}
